<template>
  <div class="job-list">
    <div
      class="job-item clearfix"
      v-for="j in jobList"
      :key="j.id"
      @click="jumpTo(j)"
    >
      <div class="job-pos">
        <div class="text">
          <span class="job-name">{{ j.name }}</span>
          <span class="money" v-if="j.payid">{{ j.payid }}-{{ j.pay_end }}k</span>
        </div>
        <div class="wrap">
          <p>
            <i class="iconfont icon-map"></i><span>{{ j.city_name }}</span>
          </p>
          <p>
            <i class="iconfont icon-edit"></i>
            <span>{{ j.is_all === 0 ? '实习' : '全职' }}</span>
          </p>
          <p>
            <i class="iconfont icon-hat"></i><span>{{ j.eid }}</span>
          </p>
          <p>
            <i class="iconfont icon-time"></i><span>{{ j.end_time_cn }}</span>
          </p>
        </div>
      </div>
      <div class="job-company">
        <p class="name">{{ j.cname }}</p>
        <p class="type">{{ j.industry }}</p>
      </div>
      <div class="job-logo" :style="{background: 'url('+ j.logo +') center / cover no-repeat'}">
      </div>
      <div class="pro">
        <span class="text">{{ j.status_cn }}</span>
        <span class="time"
          >{{ j.edittime }} {{ j.status === 1 ? '投递' : '被查看' }}</span
        >
      </div>
    </div>
  </div>
</template>

<script>

export default {
  props: ['list'],
  data () {
    return {
      jobList: [],
    }
  },
  created () {
  },
  mounted () {

  },
  watch: {
    list (val) {
      this.jobList = val;
    }
  },
  computed: {

  },
  methods: {
    jumpTo (obj) {
      this.$router.push({
        path: '/job/detail',
        query: { id: obj.jid }
      })
    }
  },
}
</script>

<style lang="scss" scoped>
.job-list {
  margin: 20px auto;
  .job-item {
    height: 170px;
    width: 100%;
    border: 1px solid #ebebeb;
    background: #fff;
    margin-bottom: 10px;
    padding: 0 40px 0 40px;
    cursor: pointer;
    &:hover {
      background: #f6f7f8;
    }
    & > div {
      float: left;
    }
    .job-pos {
      width: 700px;
      font-size: 18px;
      margin-top: 30px;
      .job-name {
        color: #242924;
        margin-right: 40px;
      }
      .money {
        color: $base-color-important;
      }
      .wrap {
        margin-top: 10px;
        p {
          margin-right: 30px;
          color: #999;
          line-height: 20px;
          font-size: 14px;
          display: inline-block;
        }
        i {
          vertical-align: middle;
          color: #999;
          margin-right: 5px;
        }
        span {
          vertical-align: middle;
          color: #999;
        }
      }
    }
    .job-company {
      margin-top: 30px;
      width: 340px;
      .name {
        color: #24292f;
      }
      .type {
        color: #999;
        font-size: 12px;
        margin-top: 5px;
      }
    }
    .job-logo {
      margin-top: 24px;
      width: 74px;
      height: 74px;
      overflow: hidden;
    }
    .pro {
      width: 100%;
      height: 50px;
      line-height: 50px;
      margin-top: 15px;
      border-top: 1px solid #f6f7f8;
      .text {
        position: relative;
        padding-left: 15px;
        color: #999;
        height: 22px;
        line-height: 22px;
        &::before {
          content: '';
          height: 14px;
          width: 2px;
          background: #4771dc;
          position: absolute;
          left: 2px;
          top: 4px;
        }
      }
      .time {
        color: #999;
        float: right;
      }
    }
  }
}
</style>
